package lee.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lee.mapper.UserMapper;
import lee.po.UserPO;
import lee.service.UserService;
import lee.vo.UserVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (User)表服务实现类
 *
 * @author XD
 * @since 2021-02-07 21:51:53
 */
@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, UserPO> implements UserService {
    @Resource
    private UserMapper userMapper;


    @Override
    public UserPO findUserByUsername(String username) {
        LambdaQueryWrapper<UserPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UserPO::getUsername, username);
        return userMapper.selectOne(queryWrapper);
    }

    @Override
    public List<UserVO> findPermission(String id) {
        return userMapper.findPermission(id);
    }
}
